import React from "react";
import {Card} from "antd-mobile";
import "./orderItem.css";
import {formatDate} from "../../../utils/common";
import {Link} from "react-router-dom";
class OrderItem extends React.Component {
    render() {
        return (
            <Link to={{pathname: "/reserve-order-detail", query: {id: this.props.order.parkingReservedOrderId}}}>
                <Card className={"order-item"}>
                    <Card.Body>
                        <div className={"title"}>
                            {this.props.order.parkingLotName}
                        </div>
                        <div className={"seat"}>
                            车位编号：{this.props.order.parkingSpaceCode}
                        </div>
                        <div className={"address"}>
                            详细地址：{this.props.order.parkingLotAddress}
                        </div>
                        <div className={"time"}>
                            <label>预约进场时间：</label>
                            <span>{formatDate(this.props.order.reserveParkingTime)}</span>
                        </div>
                        <div className={"time"}>
                            <label>预约取车时间：</label>
                            <span>{formatDate(this.props.order.reserveFetchingTime)}</span>
                        </div>
                    </Card.Body>
                </Card>
            </Link>
        );
    }
}
export default OrderItem;